﻿using Microsoft.Extensions.Caching.Memory;
using OAS.Application.MeetingApp.Services;
using OAS.Application.System.Dtos;
using OAS.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OAS.Application.MeetingApp
{
    public class MeetingController : IDynamicApiController
    {
        private readonly ISqlSugarClient db;
        private readonly IMeetingService _meetingService;
        public MeetingController(IMeetingService meetingService, ISqlSugarClient db)
        {
            this.db = db;
            _meetingService = meetingService;
        }
        public async Task<List<Meeting>> GetAllMeeting()
        {
            return await _meetingService.GetAllMeeting();
        }
        [HttpPost]
        public async Task<object> GetMeetingList(DtoQuery dto)
        {
            return await _meetingService.GetMeetingList(dto);
        }
        public async Task AddMeeting(Meeting meeting)
        {
            await _meetingService.AddMeeting(meeting);
        }
        public async Task UpdateMeeting(Meeting meeting)
        {
            await _meetingService.UpdateMeeting(meeting);
        }
        public async Task DeleteMeeting([FromBody] string[] ids)
        {
            await _meetingService.DeleteMeeting(ids);
        }
    }
}
